package com.future.controller;

import com.future.domain.Result;
import com.future.service.NotificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "系统消息")
public class NotificationController {
    @Autowired
    private NotificationService notificationService;
    @GetMapping("/getLikeNotification")
    @ApiOperation("获取点赞的通知")
    public Result getLikeNotification(@RequestParam Integer pageNum,
                                      @RequestParam Integer pageSize)
    {
        return notificationService.getLikeNotification(pageNum,pageSize);
    }
    @GetMapping("/getCommentNotification")
    @ApiOperation("获取评论的通知")
    public Result getCommentNotification(@RequestParam Integer pageNum,
                                         @RequestParam Integer pageSize)
    {
        return notificationService.getCommentNotification(pageNum,pageSize);
    }
    @GetMapping("/getMarkNotification")
    @ApiOperation("获取收藏的通知")
    public Result getMarkNotification(@RequestParam Integer pageNum,
                                      @RequestParam Integer pageSize)
    {
        return notificationService.getMarkNotification(pageNum,pageSize);
    }
    @GetMapping("/getQuestionNotification")
    @ApiOperation("获取问卷系统通知")
    public Result getQuestionNotification(@RequestParam Integer pageNum,
                                          @RequestParam Integer pageSize)
    {
        return notificationService.getQuestionNotification(pageNum, pageSize);
    }
    @GetMapping("/getUnreadCountByType")
    @ApiOperation("根据通知类型获取未读通知数")
    public Result  getLikCount(@RequestParam String notificationType)
    {
        return notificationService.getUnreadCountByType(notificationType);
    }
    @DeleteMapping("/delectNotification")
    @ApiOperation("根据消息id删除消息")
    public Result delectNotifcation(@RequestParam String notificationId)
    {
        return notificationService.delectNoticication(notificationId);
    }
}
